<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文本同步示例</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        .container {
            margin-bottom: 20px;
        }
        #inputText {
            width: 300px;
            height: 100px;
            font-size: 16px;
        }
        #displayText {
            width: 300px;
            height: 100px;
            border: 1px solid #ccc;
            padding: 10px;
            font-size: 16px;
            white-space: pre-wrap; /* 保留换行符和空格 */
        }
    </style>
</head>
<body>
    <div class="container">
        <label for="inputText">输入内容：</label><br>
        <textarea id="inputText" placeholder="请输入内容..."></textarea>
    </div>
    <div class="container">
        <label for="displayText">显示内容：</label><br>
        <div id="displayText"></div>
    </div>

    <script src="script.js"></script>
</body>
</html>